package URL;

import java.awt.Graphics;
import java.awt.GraphicsEnvironment;
import java.awt.Rectangle;
import java.awt.Robot;
import java.awt.Toolkit;
import java.awt.image.BufferedImage;
import java.io.File;
import java.io.IOException;

import javax.imageio.ImageIO;
import javax.swing.JFrame;

public class DrawImage extends JFrame{
	private static final long serialVersionUIP=1l;
	private BufferedImage image;
	public DrawImage(){
		
		setDefaultCloseOperation(EXIT_ON_CLOSE);//设置一个默认的关闭操作
		this.setUndecorated(true);//全屏显示
		GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice().setFullScreenWindow(this);//设置全屏模式
		File file=new File("e:\\2.jpg");//创建图片文件
		try {
			image=ImageIO.read(file);//读取图片
			repaint();//重新绘制
		} catch (IOException e) {
			// TODO: handle exception
			e.printStackTrace();
		}
		}
	public void paint(Graphics g){
		g.drawImage(image,0,0,this);
}
	public static void main(String[] args) {
		new DrawImage();
	}
}
